﻿using CIS.Common.Dtos.CommandDtos;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CIS.Server.EQLinker.Equipment
{
    public class EquipmentCommandHandler : IRequestHandler<PortControlCommandDto, PortControlCommandDto>
    {
        private readonly IEQLinkerService _eqlinkerService;

        public EquipmentCommandHandler(IEQLinkerService eQLinkerService)
        {
            _eqlinkerService = eQLinkerService;
        }
        public async Task<PortControlCommandDto> Handle(PortControlCommandDto request, CancellationToken cancellationToken)
        {
            request =await _eqlinkerService.SendServerRequest("EQLinker",request);
            return request;
        }
    }
}
